<!--{template admin/tpl/header}-->

<div class="mainarea">
<div class="maininner">

<div class="tabs_header">
	<ul class="tabs">
		<li$actives[view]><a href="admincp.php?ac=click"><span>浏览全部动作</span></a></li>
		<li$actives[blogid]><a href="admincp.php?ac=click&idtype=blogid"><span>日志动作</span></a></li>
		<li$actives[picid]><a href="admincp.php?ac=click&idtype=picid"><span>图片动作</span></a></li>
		<li$actives[tid]><a href="admincp.php?ac=click&idtype=tid"><span>话题动作</span></a></li>
		<li class="null"><a href="admincp.php?ac=click&op=add">添加新动作</a></li>
	</ul>
</div>

<!--{if empty($_GET['op'])}-->

	<!--{eval $idtypename=array('blogid'=>'日志','picid'=>'图片','tid'=>'话题')}-->
	
	<form method="post" action="admincp.php?ac=click">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<div class="bdrcontent">
		<table cellspacing="0" cellpadding="0" class="formtable">
		<tr>
			<th>图标</th>
			<th>动作名称</th>
			<th>系统类型</th>
			<th>显示顺序</th>
			<th>&nbsp;</th>
		</tr>
		<!--{loop $list $value}-->
		<tr>
			<td><img src="image/click/$value[icon]"></td>
			<td>$value[name]</td>
			<td>{$idtypename[$value[idtype]]}</td>
			<td><input type="text" name="displayorder[{$value[clickid]}]" value="$value[displayorder]" size="5"></td>
			<td>
				<a href="admincp.php?ac=click&op=edit&clickid=$value[clickid]">编辑</a> | 
				<a href="admincp.php?ac=click&op=delete&clickid=$value[clickid]" onclick="return confirm('删除不可恢复\n并会同时清除相关统计数据\n确认删除？');">删除</a>
			</td>
		</tr>
		<!--{/loop}-->
		</table>
	</div>
	<div class="footactions">
		<input type="submit" name="ordersubmit" value="提交" class="submit">
	</div>

	</form>

<!--{elseif $_GET['op'] == 'add' || $_GET['op'] == 'edit'}-->

	<form method="post" action="admincp.php?ac=click">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	
	<div class="bdrcontent">
		
		<table cellspacing="0" cellpadding="0" class="formtable">
		<tr><th style="width:12em;">动作名称</th>
			<td><input type="text" name="name" value="$click[name]"></td></tr>
		<tr><th>动作图标</th>
			<td>./image/click/<input type="text" name="icon" value="$click[icon]" size="15">
			<br>需要确保将该图片上传到程序的 ./image/click/ 目录下面。
			</td></tr>
		<!--{if $_GET['op'] == 'add'}-->
		<tr><th>系统类型</th>
			<td>
			<select name="idtype">
			<option value="blogid"$idtypearr[blogid]>日志</option>
			<option value="picid"$idtypearr[picid]>图片</option>
			<option value="tid"$idtypearr[tid]>话题</option>
			</select>
			</td></tr>
		<!--{/if}-->
		<tr><th>显示顺序</th>
			<td><input type="text" name="displayorder" value="$click[displayorder]"></td></tr>
		</table>
	</div>
	
	<div class="footactions">
		<input type="hidden" name="clickid" value="$click[clickid]">
		<input type="submit" name="clicksubmit" value="提交" class="submit">
	</div>

	</form>

<!--{/if}-->
</div>
</div>

<div class="side">
	<!--{template admin/tpl/side}-->
</div>

<!--{template admin/tpl/footer}-->